#!/usr/bin/env gnuplot
set title "sin(x)函数图像"
set samples 1000 #设置采样点数
unset key #取消显示key
#坐标设置
set xlabel "时间" 
set ylabel "幅度"
#设置x坐标区间
set xrange [-2*pi:2*pi] 
set yrange [-1.2:1.2]
#设置坐标刻度
#set xtics pi #设置横轴主刻度
#set mxtics 2 #设置分刻度
set ytics -1,0.5,1
set xtics(\
    "−2π"   -2*pi   0   ,\
    ""      -1.5*pi 1   ,\
    "−π"    -1*pi   0   ,\
    ""      -0.5*pi 1   ,\
    "0"     0       0   ,\
    ""      0.5*pi  1   ,\
    "π"     1*pi    0   ,\
    ""      1.5*pi  1   ,\
    "2π"    2*pi    0   \
)
plot sin(x)

pause 10
exit